<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/7/4
  Time: 15:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>crud</title>
    <!--引入jQuery-->
    <script src="http://code.jquery.com/jquery-1.12.4.min.js" type="text/javascript"></script>
    <!--引入css和js-->
    <link href="static/css/bootstrap.min.css" rel="stylesheet">
    <script src="static/js/bootstrap.min.js"></script>
</head>
<body>
<!--自动填充的栅式布局-->

<div class="container">
    <!--标题-->
    <div class="row">
        <div class="col-lg-8 col-lg-offset-4"><h1>学生信息管理</h1></div>
    </div>
    <!--按钮-->
    <div class="row">
        <div class="col-lg-4 col-lg-offset-8">
            <a href="#" class="btn btn-danger btn-lg " role="button">新增</a>
            <a href="#" class="btn btn-primary btn-lg " role="button">删除</a>
        </div>
    </div>
    <!--显示表格数据-->
    <div class="row">
        <div>
            <table class="table table-hover">
                <tr>
                    <th>学生学号</th>
                    <th>学生姓名</th>
                    <th>学生班级</th>
                    <th>学生年级</th>
                    <th>操 作</th>
                </tr>
                <c:forEach items="${info.list}" var="student">
                    <tr>
                        <th>${student.studentId}</th>
                        <th>${student.studentName}</th>
                        <th>${student.studentClass}</th>
                        <th>${student.studentGrade}</th>
                        <th>
                            <a href="/update" class="btn btn-success  btn-lg " role="button">
                                <span class="glyphicon glyphicon-user" aria-hidden="true"/>
                                修改</a>
                            <a href="/delete" class="btn btn-warning  btn-lg " role="button">
                                <span class="glyphicon glyphicon-user" aria-hidden="true"/>
                                删除</a>
                        </th>
                    </tr>
                </c:forEach>
            </table>
        </div>
    </div>
    <!--显示分页信息-->
    <div class="row">
        <!--显示分页信息-->
        <div class="col-lg-6">
            当前为第${info.pageNum}页,共${info.pages}页，共有记录${info.total}条
        </div>
        <!--显示分页条-->
        <div class="col-lg-6">
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <c:if test="${!info.isFirstPage}">
                        <li><a href="/students?page=1">首页</a></li>
                    </c:if>
                    <c:if test="${info.hasPreviousPage}">
                        <li>
                            <a href="/students?page=${info.prePage}" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                    </c:if>
                    <c:forEach items="${info.navigatepageNums}" var="page">
                        <c:if test="${page==info.pageNum}">
                            <li class="active"><a href="#">${page}</a></li>
                        </c:if>
                        <c:if test="${page!=info.pageNum}">
                            <li><a href="/students?page=${page}">${page}</a></li>
                        </c:if>
                    </c:forEach>

                    <c:if test="${info.hasNextPage}">
                        <li>
                            <a href="/students?page=${info.nextPage}" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </c:if>
                    <c:if test="${!info.isLastPage}">
                        <li><a href="/students?page=${info.pages}">尾页</a></li>
                    </c:if>
                </ul>
            </nav>
        </div>
    </div>
</div>
</body>
</html>









<!-- Button trigger modal -->
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
    Launch demo modal
</button>

